//vue3 使用多线程大文件分片上传
<template>
    <div>
        <div class="upload-container">
            <div class="upload-container__title">上传文件</div>
            <div class="upload-container__content">
                <div class="upload-container__content__input">
                    <input type="file" id="file" ref="file" @change="handleFileChange" multiple />
                </div>
            </div>
        </div>
    </div>
</template>
<script setup>
import { ref, reactive, onMounted } from "vue";
import { uploadFile } from "@/api/upload";

import { cutFile } from "./unit"
const size = 1024 * 1024;
const threadConut = navigator.hardwareConcurrency || 4;

const handleFileChange = async (e) => {
    const files = e.target.files;
    if (files.length > 0) {
        cutFile(files[0]).then(e => {
            uploadFile({
                file: e,
            }).then(res => {
                
            })
        })
    }
};


</script>